﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Transactions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace GMSTest
{
    [TestClass]
    public class UnitTest1
    {
        #region Common Methods

        [TestMethod]
        public void TestGetShapes()
        {
            List<DAL.Shape> s = BLL.Common.GetShapes();
            Assert.IsNotNull(s);
        }

        [TestMethod]
        public void TestGetSideType()
        {
            List<DAL.SideType> st = BLL.Common.GetSideType();
            Assert.IsNotNull(st);
        }

        [TestMethod]
        public void TestGetProjectType()
        {
            List<DAL.ProjectType> pt = BLL.Common.GetProjectType();
            Assert.IsNotNull(pt);
        }

        [TestMethod]
        public void TestGetProjectUrgency()
        {
            List<DAL.ProjectUrgency> pu = BLL.Common.GetProjectUrgency();
            Assert.IsNotNull(pu);
        }

        [TestMethod]
        public void TestGetEdges()
        {
            List<DAL.Edge> e = BLL.Common.GetEdges();
            Assert.IsNotNull(e);
        }

        [TestMethod]
        public void TestGetStones()
        {
            List<DAL.Stone> s = BLL.Common.GetStones();
            Assert.IsNotNull(s);
        }

        [TestMethod]
        public void TestGetStoneType()
        {
            List<DAL.StoneType> st = BLL.Common.GetStoneType();
            Assert.IsNotNull(st);
        }

        #endregion Common Methods

        #region Presentation Layer Methods

        [TestMethod]
        public void TestAddUserDetails()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {

            }
        }

        #endregion Presentation Layer Methods

        #region Admin Methods

        [TestMethod]
        public void TestAddShape()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddShape("name", "description", "thumbnail.png", "imagename.png");

                Assert.IsNotNull(id);
                Assert.IsTrue(id > 0);
            }
        }

        [TestMethod]
        public void TestSaveShape()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddShape("name", "description", "thumbnail.png", "imagename.png");
                bool success = BLL.Common.SaveShape(id, "name1", "description1", "thumbnail1.png", "imagename1.png", false);

                Assert.IsNotNull(success);
                Assert.IsTrue(success);
            }
        }

        [TestMethod]
        public void TestAddSideType()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddSideType(100, "name", "description", "imagePath");

                Assert.IsNotNull(id);
                Assert.IsTrue(id > 0);
            }
        }

        [TestMethod]
        public void TestSaveSideType()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddSideType(100, "name", "description", "imagePath");
                bool success = BLL.Common.SaveSideType(id, 1, "name1", "description1", "imagePath1", false);

                Assert.IsNotNull(success);
                Assert.IsTrue(success);
            }
        }

        [TestMethod]
        public void TestAddEdge()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddEdge("name", "description", "thumbnail", "imagename.png", 20);

                Assert.IsNotNull(id);
                Assert.IsTrue(id > 0);
            }
        }

        [TestMethod]
        public void TestSaveEdge()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddEdge("name", "description", "thumbnail", "imagename.png", 20);
                bool success = BLL.Common.SaveEdge(id, 1, "name1", "description1", "thumbnail1.png", "imagename1.png", false);

                Assert.IsNotNull(success);
                Assert.IsTrue(success);
            }
        }

        [TestMethod]
        public void TestAddStone()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                List<DAL.StoneType> st = BLL.Common.GetStoneType();
                List<DAL.StoneCategory> sc = BLL.Common.GetStoneCategory();
                if (st != null && st.Count > 0)
                {
                    int id = BLL.Common.AddStone("name", "description", "thumbnail.png", "imagename.png", Convert.ToInt32(st[0].Id),
                        Convert.ToInt32(sc[0].Id), "India", "3cm (1.18in)", 1);

                    Assert.IsNotNull(id);
                    Assert.IsTrue(id > 0);
                }
            }
        }

        [TestMethod]
        public void TestSaveStone()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int stoneTypeId = BLL.Common.AddStoneType(1, "name", "description", "imagePath");
                int stoneCategoryId = BLL.Common.AddStoneType(1, "name", "description", "imagePath");
                int id = BLL.Common.AddStone("name", "description", "thumbnail.png", "imagename.png", stoneTypeId,
                    stoneCategoryId, "India", "3cm (1.18in)", 1);
                bool success = BLL.Common.SaveStone(id, "name1", "description1", "thumbnail1.png", "imagename1.png",
                    stoneTypeId, stoneCategoryId, "India1", "3cm (1.18in)1", 1, false);

                Assert.IsNotNull(success);
                Assert.IsTrue(success);
            }
        }

        [TestMethod]
        public void TestAddStoneType()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddStoneType(1, "name", "description", "imagePath");

                Assert.IsNotNull(id);
                Assert.IsTrue(id > 0);
            }
        }

        [TestMethod]
        public void TestSaveStoneType()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddStoneType(1, "name", "description", "imagePath");
                bool success = BLL.Common.SaveStoneType(id, 1, "name1", "description1", "imagePath", false);

                Assert.IsNotNull(success);
                Assert.IsTrue(success);
            }
        }

        [TestMethod]
        public void TestAddProjectType()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddProjectType(1, "name", "description", "imagePath");

                Assert.IsNotNull(id);
                Assert.IsTrue(id > 0);
            }
        }

        [TestMethod]
        public void TestSaveProjectType()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddProjectType(1, "name", "description", "imagePath");
                bool success = BLL.Common.SaveProjectType(id, 1, "name1", "description1", "imagePath1", false);

                Assert.IsNotNull(success);
                Assert.IsTrue(success);
            }
        }

        [TestMethod]
        public void TestAddProjectUrgency()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddProjectUrgency(1, "name", "description", "imagePath");

                Assert.IsNotNull(id);
                Assert.IsTrue(id > 0);
            }
        }

        [TestMethod]
        public void TestSaveProjectUrgency()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {
                int id = BLL.Common.AddProjectUrgency(1, "name", "description", "imagePath");
                bool success = BLL.Common.SaveProjectUrgency(id, 1, "name1", "description1", "imagePath1", false);

                Assert.IsNotNull(success);
                Assert.IsTrue(success);
            }
        }

        [TestMethod]
        public void TestAddZipSurcharge()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {

            }
        }

        [TestMethod]
        public void TestSaveZipSurcharge()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {

            }
        }

        [TestMethod]
        public void TestAddPrice()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {

            }
        }

        [TestMethod]
        public void TestSavePrice()
        {
            using (TransactionScope transactionScope = new TransactionScope())
            {

            }
        }

        #endregion Admin Methods
    }
}
